int incomingByte = 0;	

#define OUTLET_ONE 5
#define OUTLET_TWO 6
#define OUTLET_THREE 7

void setup() {
  Serial.begin(9600);	// opens serial port, sets data rate to 9600 bps
  pinMode(OUTLET_ONE, OUTPUT);      // sets the digital pin as output
  pinMode(OUTLET_TWO, OUTPUT);      // sets the digital pin as output
  pinMode(OUTLET_THREE, OUTPUT);      // sets the digital pin as output
  
  digitalWrite(OUTLET_ONE, HIGH);
  digitalWrite(OUTLET_TWO, HIGH);
  digitalWrite(OUTLET_THREE, HIGH);
}

void loop() {
  if (Serial.available() > 0) {		
    incomingByte = Serial.read(); 
    
    switch (incomingByte) {                  
      case '1' :
        Serial.print("1");
        toggleOne();    
        break;
                  
      case '2' :
        Serial.print("2");
        toggleTwo();
        break;
                    
      case '3' :
        Serial.print("3");
        toggleThree();
        break;
                    
      default: 
      Serial.print("e");
    }
  }
}

void toggleOne() {
  digitalWrite(OUTLET_ONE, LOW);
  delay(500);
  digitalWrite(OUTLET_ONE, HIGH);
}


void toggleTwo() {
  digitalWrite(OUTLET_TWO, LOW);
  delay(500);
  digitalWrite(OUTLET_TWO, HIGH);
}

void toggleThree() {
  digitalWrite(OUTLET_THREE, LOW);
  delay(500);
  digitalWrite(OUTLET_THREE, HIGH);
}
